
using System;
using System.Data;
using System.Data.SqlClient;
using System.Data.SqlTypes;
using System.Collections.Generic;
using System.Linq;
using System.Text;
/*
 * This class is the basic class for data base accessing.
 * This includes the comon methods, data, value.... for every other data accessing class.
 * Others DAO class will inherit this class.
 * 
 * */

namespace BaHuan.DataLayer
{
	public class BaseDAO
	{
		public SqlParameter CreateParameter(string paramName, DbType type, ParameterDirection direction, object paramValue)
		{
			SqlParameter param = new SqlParameter();
			param.ParameterName = paramName;
			param.DbType = type;
			param.Direction = direction;
			param.Value = paramValue;

			return param;
		}

		public SqlCommand CreateSqlCommand(string cmdName, CommandType cmdType)
		{
			SqlCommand cmd = DataConnection.GetSqlConnection().CreateCommand();
			cmd.CommandText = cmdName;
			cmd.CommandType = cmdType;

			return cmd;
		}
	}
}
